package org.fig.ioc.bean.definition;

import org.fig.ioc.overview.domain.User;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description:
 * @Author: Flynn Vanderboom
 * @Data: 2021/6/15 15:01
 */

public class BeanAliasDemo {
    public static void main(String[] args) {
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("classpath:/META-INF/bean-definitions-context.xml");
        
        User userAlias= beanFactory.getBean("user-alias",User.class);
        User user = beanFactory.getBean("user",User.class);
        System.out.println(user==userAlias);
    }
}
